import Card from 'react-bootstrap/Card';
import { ReactNode } from 'react';


interface Props {
  children?: ReactNode,
  header?: string;
  title?: string;
  isText: boolean;
}

const Block = ({ children, header, title, isText }: Props) => {
    return (
      <Card className="mb-3">
        {
          !header || <Card.Header>{header}</Card.Header>
        }
        <Card.Body>
          {
            !title || <Card.Title>{title}</Card.Title>
          }
          {
            isText ? (
              <Card.Text>
                {children}
              </Card.Text>
            ) : (
              <>
                {children}
              </>
            )
          }
        </Card.Body>
      </Card>
    );
};

export default Block;